home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / taropyon / guilib3 / inc / cns / cnscf.h
C/C++ Source or Header  |  1993-11-30  |  3KB  |  59 lines

  1. #ifndef    _CNSCF_H
  2. #define    _CNSCF_H
  3.  
  4. /*    画面内に表示可能な文字数を計算するマクロ    */
  5. #define    CNS_DSPCNT(cns,_x,_y)    {                                                \
  6.     _x = (((cns)->tFr.x2-(cns)->tFr.x1+1) + ((cns)->fntX + (cns)->spcX - 1))    \
  7.         / ((cns)->fntX + (cns)->spcX);                                            \
  8.     _y = (((cns)->tFr.y2-(cns)->tFr.y1+1) + ((cns)->fntY + (cns)->spcY - 1))    \
  9.          / ((cns)->fntY + (cns)->spcY);                                            \
  10.     }
  11. #define    CNS_DSPDSP(cns,_x,_y)    {                                                \
  12.     _x = (((cns)->tFr.x2-(cns)->tFr.x1+1) + ((cns)->fntX + (cns)->spcX - 1))    \
  13.         / ((cns)->fntX + (cns)->spcX);                                            \
  14.     if ( ((cns)->tFr.x2 - (cns)->tFr.x1 + 1) % ((cns)->fntX + (cns)->spcX) )    \
  15.         --(_x);                                                                    \
  16.     _y = (((cns)->tFr.y2-(cns)->tFr.y1+1) + ((cns)->fntY + (cns)->spcY - 1))    \
  17.          / ((cns)->fntY + (cns)->spcY);                                            \
  18.     if ( ((cns)->tFr.y2 - (cns)->tFr.y1 + 1) % ((cns)->fntY + (cns)->spcY) )    \
  19.         --(_y);                                                                    \
  20.     }
  21.  
  22.  
  23. #define    CNSCOL_STR(cns)        ((cns)->colTbl[ 0])    /* 文字            */
  24. #define    CNSCOL_BAC(cns)        ((cns)->colTbl[ 1])    /* 背景            */
  25. #define    CNSCOL_SELSTR(cns)    ((cns)->colTbl[ 2])    /* 選択中        */
  26. #define    CNSCOL_SELBAC(cns)    ((cns)->colTbl[ 3])
  27. #define    CNSCOL_MKST(cns)    ((cns)->colTbl[ 4])    /* マーク文字    */
  28. #define    CNSCOL_MKBK(cns)    ((cns)->colTbl[ 5])    /* マーク背景    */
  29. #define    CNSCOL_TAB(cns)        ((cns)->colTbl[ 6])    /* TAB            */
  30. #define    CNSCOL_CRLF(cns)    ((cns)->colTbl[ 7])    /* 改行            */
  31. #define    CNSCOL_CTRL(cns)    ((cns)->colTbl[ 8])    /* 制御文字        */
  32. #define    CNSCOL_KS(cns)        ((cns)->colTbl[ 9])    /* 全角スペース    */
  33. #define    CNSCOL_MIFR(cns)    ((cns)->colTbl[10])    /* 未表示エリア    */
  34. #define    CNSCOL_MIBK(cns)    ((cns)->colTbl[11])    /* 未表示エリア背景            */
  35. #define    CNSCOL_LNST(cns)    ((cns)->colTbl[12])    /* 行番号文字                */
  36. #define    CNSCOL_LNBK(cns)    ((cns)->colTbl[13])    /* 行番号背景                */
  37. #define    CNSCOL_CUR(cns)        ((cns)->colTbl[14])    /* カーソル                    */
  38. #define    CNSCOL_CRUL(cns)    ((cns)->colTbl[15])    /* カーソルアンダーライン    */
  39. #define    CNSCOL_COST(cns)    ((cns)->colTbl[16])    /* 桁位置ゲージ文字            */
  40. #define    CNSCOL_COBK(cns)    ((cns)->colTbl[17])    /* 桁位置ゲージ背景            */
  41. #define    CNSCOL_FMST(cns)    ((cns)->colTbl[18])    /* 検索マッチ文字            */
  42. #define    CNSCOL_FMBK(cns)    ((cns)->colTbl[19])    /* 検索マッチ背景            */
  43. #define    CNSCOL_REST(cns)    ((cns)->colTbl[20])    /* 矩形編集文字                */
  44. #define    CNSCOL_REBK(cns)    ((cns)->colTbl[21])    /* 矩形編集文字                */
  45. #define    CNSCOL_FRAME(cns)    ((cns)->colTbl[22])    /* 外枠(内部では使わない)    */
  46. #define    CNSCOL_CNSSTR(cns)    ((cns)->colTbl[30])    /* コンソール文字            */
  47. #define    CNSCOL_CNSBAC(cns)    ((cns)->colTbl[31])    /* コンソール背景            */
  48.  
  49.  
  50. extern    void    _cns_put12_spc( CNS_T *cns, int x, int y, int ch );
  51. extern    void    _cns_put12_ank( CNS_T *cns, int x, int y, int ch );
  52. extern    void    _cns_put12_kan( CNS_T *cns, int x, int y, int sjis);
  53.  
  54. extern    void    _cns_put16_spc( CNS_T *cns, int x, int y, int ch );
  55. extern    void    _cns_put16_ank( CNS_T *cns, int x, int y, int ch );
  56. extern    void    _cns_put16_kan( CNS_T *cns, int x, int y, int sjis);
  57.  
  58. #endif
  59.